package com.zero.business.order.feign.sentinel;


import com.zero.domain.Bicycle;
import com.zero.business.order.feign.OrderBicycleFeign;
import com.zero.common.constants.CodeConstants;
import com.zero.common.exception.ServiceException;
import org.springframework.stereotype.Component;

/*
*   OrderBicycleFeign 的降级方法类
* */
@Component  // 放入spring容器
public class OrderBicycleFeignSentinel implements OrderBicycleFeign {

    /*
    *   服务降级方法
    * */
    @Override
    public Bicycle selectByPrimaryKey(Integer bicycleId) {

        throw new ServiceException(CodeConstants.LOWER_SERVICE, "操作失败，订单模块 远程调用 单车模块 的服务已被降级或熔断1");

    }

    /*
     *   服务降级方法
     * */
    @Override
    public void updateByPrimaryKeySelective(Integer bicycleId, String status, String remark) {

        throw new ServiceException(CodeConstants.LOWER_SERVICE, "操作失败，订单模块 远程调用 单车模块 的服务已被降级或熔断2");

    }



}
